package a.h;

import a.i.jb;

import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.*;
import java.beans.PropertyVetoException;
import java.util.*;

class q
  extends d
{
  private static final float n = (float)Math.rint(ad.b("Label.font") * 0.8D);
  private static final byte o = 0;
  private static final byte p = 1;
  private static final byte q = 2;
  private final b_ r;
  private final JPanel s;
  private final JSlider t;
  private final JTextField u;
  private final f_ v;
  private final h_ w;
  private final ob x;
  private final Map y;
  private boolean z;
  private Number A;
  static Class B;
  static Class C;
  static Class D;
  
  public static tb a(nc paramnc, Map paramMap, ob paramob)
  {
    return new q(paramnc, paramMap, paramob);
  }
  
  public static tb a(jc paramjc, Map paramMap, ob paramob)
  {
    return new q(paramjc, paramMap, paramob);
  }
  
  private q(nc paramnc, Map paramMap, ob paramob)
  {
    super(paramnc);
    this.x = paramob;
    this.r = new d_(paramnc);
    this.s = new JPanel(new GridBagLayout());
    this.u = new JTextField(4);
    this.t = new JSlider();
    this.y = paramMap;
    this.v = (!a() ? new f_(null) : new g_());
    this.v.a(false);
    this.w = new h_(null);
    this.w.a(false);
    b();
    this.v.a(true);
    this.w.a(true);
  }
  
  private q(jc paramjc, Map paramMap, ob paramob)
  {
    super(paramjc);
    this.x = paramob;
    this.r = new c_(paramjc);
    this.s = new JPanel(new GridBagLayout());
    this.u = new JTextField(4);
    this.t = new JSlider();
    this.y = paramMap;
    this.v = (!a() ? new f_(null) : new g_());
    this.v.a(false);
    this.w = new h_(null);
    this.w.a(false);
    b();
    this.v.a(true);
    this.w.a(true);
  }
  
  public Object n()
  {
    return this.A;
  }
  
  public void a(Object paramObject)
  {
    Number localNumber = this.A;
    if ((ec.t != 0) || (nb.a(localNumber, paramObject)))
    {
      try
      {
        b(e, localNumber, paramObject);
      }
      catch (PropertyVetoException localPropertyVetoException)
      {
        this.r.a(localNumber, (byte)2);
        return;
      }
      this.A = ((Number)paramObject);
      this.r.a(this.A, (byte)2);
      a(localNumber, paramObject);
    }
  }
  
  public boolean o()
  {
    return this.s.isEnabled();
  }
  
  public void c(boolean paramBoolean)
  {
    int i = ec.t;
    boolean bool2 = ec.s;
    boolean bool1 = o();
    if (i == 0)
    {
      if (bool1 != paramBoolean)
      {
        this.s.setEnabled(paramBoolean);
        this.t.setEnabled(paramBoolean);
      }
    }
    else
    {
      Color localColor = ad.a(paramBoolean ? "Label.foreground" : "Label.disabledForeground");
      Dictionary localDictionary = this.t.getLabelTable();
      if ((i != 0) || (localDictionary != null))
      {
        Enumeration localEnumeration = localDictionary.keys();
        do
        {
          do
          {
            Object localObject;
            do
            {
              if (!localEnumeration.hasMoreElements()) {
                break;
              }
              localObject = localDictionary.get(localEnumeration.nextElement());
            } while (!(localObject instanceof JComponent));
            ((JComponent)localObject).setForeground(localColor);
            if ((i != 0) || ((i == 0) && (bool2))) {
              break label156;
            }
          } while (i != 0);
        } while (!bool2);
      }
      this.u.setEnabled(paramBoolean);
      label156:
      a(bool1, paramBoolean);
    }
  }
  
  public boolean p()
  {
    return this.z;
  }
  
  public void d(boolean paramBoolean)
  {
    int i = ec.t;
    boolean bool = p();
    if (i == 0)
    {
      if (bool == paramBoolean) {
        return;
      }
      if (i == 0) {
        this.z = paramBoolean;
      }
    }
    else if (paramBoolean)
    {
      this.u.setBackground(ad.d());
      if (i != 0) {
        break label88;
      }
      this.u.setText("");
      if (!ec.s) {
        break label87;
      }
    }
    this.u.setBackground(o() ? ad.a("TextField.background") : ad.a("TextField.inactiveBackground"));
    label87:
    label88:
    b(bool, paramBoolean);
  }
  
  public JComponent f()
  {
    return this.s;
  }
  
  private boolean a()
  {
    boolean bool;
    if (this.y != null)
    {
      bool = Boolean.TRUE.equals(this.y.get("ItemEditor.selectTextOnFocusGained"));
      if (ec.t != 0) {
        break label54;
      }
      if (!ec.s) {}
    }
    else
    {
      bool = Boolean.TRUE.equals(this.i.c("ItemEditor.selectTextOnFocusGained"));
    }
    label54:
    return bool;
  }
  
  private void b()
  {
    this.u.addFocusListener(this.v);
    this.u.addKeyListener(this.v);
    this.u.addMouseListener(this.v);
    this.t.setPaintLabels(true);
    this.t.setMinorTickSpacing(1);
    this.t.setSnapToTicks(true);
    this.t.addChangeListener(this.w);
    GridBagConstraints localGridBagConstraints = new GridBagConstraints();
    localGridBagConstraints.gridx = 0;
    localGridBagConstraints.gridy = 0;
    localGridBagConstraints.fill = 2;
    localGridBagConstraints.weightx = 0.5D;
    this.s.add(this.t, localGridBagConstraints);
    localGridBagConstraints = new GridBagConstraints();
    localGridBagConstraints.insets.left = 10;
    localGridBagConstraints.gridy = 0;
    localGridBagConstraints.fill = 2;
    localGridBagConstraints.weightx = 0.5D;
    this.s.add(this.u, localGridBagConstraints);
    this.A = ((Number)this.i.o());
    this.r.b(this.A);
    d(this.i.m());
    c(this.i.f());
    g();
  }
  
  private void g()
  {
    Dimension localDimension = this.u.getPreferredSize();
    localDimension.width = 500;
    this.u.setMaximumSize(localDimension);
    localDimension = this.t.getPreferredSize();
    localDimension.width = 100;
    this.t.setPreferredSize(localDimension);
  }
  
  private static Locale a(ec paramec)
  {
    return (Locale)paramec.c(jc.C);
  }
  
  private String a(String paramString)
  {
    int i = ec.t;
    StringBuffer localStringBuffer = new StringBuffer(100);
    String str = (String)this.i.c(ec.c);
    if (i == 0)
    {
      if (str != null)
      {
        if (i != 0) {
          break label130;
        }
        if (str.length() != 0) {}
      }
      else
      {
        localStringBuffer.append(this.i.d());
      }
    }
    else
    {
      if (i == 0)
      {
        if (localStringBuffer.length() <= 0) {
          break label142;
        }
        localStringBuffer.append('.');
      }
      if (i != 0) {
        break label130;
      }
      if (!ec.s) {
        break label142;
      }
    }
    localStringBuffer.append(str).append('.');
    localStringBuffer.append(this.i.d());
    if (i == 0) {
      label130:
      if (localStringBuffer.charAt(localStringBuffer.length() - 1) == '.') {}
    } else {
      localStringBuffer.append('.');
    }
    label142:
    if (i == 0)
    {
      if (this.x != null) {
        localStringBuffer.append(paramString);
      }
    }
    else {
      return this.x.b(localStringBuffer.toString());
    }
    return paramString;
  }
  
  static Class b(String paramString)
  {
    try
    {
      return Class.forName(paramString);
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
  
  private static class e_
  {
    private boolean a = true;
    
    public boolean a()
    {
      return this.a;
    }
    
    public void a(boolean paramBoolean)
    {
      this.a = paramBoolean;
    }
  }
  
  private final class h_
    extends q.e_
    implements ChangeListener
  {
    private h_() {}
    
    public void stateChanged(ChangeEvent paramChangeEvent)
    {
      if ((ec.t != 0) || (a())) {
        q.this.r.a(q.this.r.b(), (byte)0);
      }
    }
    
    h_(q.0 param0)
    {
      this();
    }
  }
  
  private class g_
    extends q.f_
  {
    private boolean b = false;
    
    public g_()
    {
      super(null);
    }
    
    public void focusGained(FocusEvent paramFocusEvent)
    {
      if (ec.t == 0) {
        if (!this.b) {
          q.this.u.selectAll();
        }
      }
      this.b = false;
    }
    
    public void mousePressed(MouseEvent paramMouseEvent)
    {
      this.b = true;
    }
  }
  
  private class f_
    extends q.e_
    implements FocusListener, KeyListener, MouseListener
  {
    private f_() {}
    
    public void focusLost(FocusEvent paramFocusEvent)
    {
      int i = ec.t;
      if (((i != 0) || (a())) && ((i != 0) || ((!q.this.p()) && (!paramFocusEvent.isTemporary()))))
      {
        q.this.r.a(q.this.r.c(), (byte)1);
        q.this.u.setCaretPosition(0);
      }
    }
    
    public void focusGained(FocusEvent paramFocusEvent) {}
    
    public void keyPressed(KeyEvent paramKeyEvent)
    {
      int i = ec.t;
      if (((i != 0) || (a())) && ((i != 0) || ((10 == paramKeyEvent.getKeyCode()) && (0 == paramKeyEvent.getModifiers())))) {
        q.this.r.a(q.this.r.c(), (byte)1);
      }
    }
    
    public void keyReleased(KeyEvent paramKeyEvent) {}
    
    public void keyTyped(KeyEvent paramKeyEvent) {}
    
    public void mouseClicked(MouseEvent paramMouseEvent) {}
    
    public void mouseEntered(MouseEvent paramMouseEvent) {}
    
    public void mouseExited(MouseEvent paramMouseEvent) {}
    
    public void mousePressed(MouseEvent paramMouseEvent) {}
    
    public void mouseReleased(MouseEvent paramMouseEvent) {}
    
    f_(q.0 param0)
    {
      this();
    }
  }
  
  private final class c_
    extends q.b_
  {
    final double a;
    final double c;
    final long d;
    final int e;
    final jb f;
    
    public c_(jc paramjc)
    {
      super(null);
      Number localNumber1 = (Number)paramjc.c(jc.y);
      Number localNumber2 = (Number)paramjc.c(jc.z);
      Number localNumber3 = (Number)paramjc.c(jc.A);
      this.a = localNumber1.doubleValue();
      this.c = localNumber2.doubleValue();
      this.e = localNumber3.intValue();
      long l = 1L;
      int i = 0;
      if (i < this.e)
      {
        l *= 10L;
        i++;
      }
      for (;;)
      {
        if ((j != 0) || (!bool))
        {
          if (!bool) {
            break;
          }
          this.d = l;
          if (j == 0) {
            this.f = new fd(q.a(paramjc), this.a, this.c);
          }
        }
      }
    }
    
    public c_(double paramDouble1, double paramDouble2, long paramLong)
    {
      super(null);
      this.a = paramDouble1;
      this.c = paramDouble2;
      this.d = paramLong;
      this.e = 1;
      this.f = new fd(q.a(q.this.i), paramDouble1, paramDouble2);
    }
    
    jb a()
    {
      return this.f;
    }
    
    void c(Number paramNumber)
    {
      if (paramNumber == null) {
        throw new IllegalArgumentException("Item value may not be null.");
      }
      q.this.w.a(false);
      q.this.t.setValue((int)Math.rint(paramNumber.doubleValue() * this.d));
      q.this.w.a(true);
    }
    
    Number b()
    {
      return new Double(d());
    }
    
    Number c()
    {
      int i = ec.t;
      double d1 = d();
      try
      {
        if (i == 0) {}
        Double localDouble1 = (Double)this.f.a(q.this.u.getText(), q.D == null ? (q.D = q.b("java.lang.Double")) : q.D);
        if ((i != 0) || (localDouble1 == null)) {
          localDouble1 = new Double(d1);
        }
        if (i == 0) {}
        q.this.u.setText(this.f.a(localDouble1, q.D == null ? (q.D = q.b("java.lang.Double")) : q.D));
        return localDouble1;
      }
      catch (NumberFormatException localNumberFormatException)
      {
        Double localDouble2 = new Double(d1);
        if (i == 0) {}
        q.this.u.setText(this.f.a(localDouble2, q.D == null ? (q.D = q.b("java.lang.Double")) : q.D));
        return localDouble2;
      }
    }
    
    void b(Number paramNumber)
    {
      ge localge = new ge(q.a(q.this.i));
      if (ec.t == 0)
      {
        if (Boolean.TRUE.equals(q.this.i.c(jc.B))) {
          localge.a(true);
        }
        q.this.u.setDocument(localge);
      }
      JLabel localJLabel1 = new JLabel(e(), 4);
      localJLabel1.setFont(localJLabel1.getFont().deriveFont(q.n));
      localJLabel1.setAlignmentX(1.0F);
      JLabel localJLabel2 = new JLabel(f(), 2);
      localJLabel2.setHorizontalAlignment(2);
      localJLabel2.setAlignmentX(1.0F);
      localJLabel2.setFont(localJLabel1.getFont());
      int i = (int)Math.rint(this.a * this.d);
      int j = (int)Math.rint(this.c * this.d);
      Hashtable localHashtable = new Hashtable(5);
      localHashtable.put(new Integer(i), localJLabel1);
      localHashtable.put(new Integer(j), localJLabel2);
      q.this.t.setMinimum(i);
      q.this.t.setMaximum(j);
      q.this.t.setLabelTable(localHashtable);
      c(paramNumber);
      a(paramNumber);
    }
    
    private double d()
    {
      int i = ec.t;
      double d1 = q.this.t.getValue() / this.d;
      if (i == 0)
      {
        if (d1 < this.a)
        {
          if (i != 0) {
            break label69;
          }
          d1 = this.a;
          if (!ec.s) {}
        }
        else
        {
          if (i != 0) {
            break label69;
          }
        }
      }
      else if (d1 > this.c) {
        d1 = this.c;
      }
      label69:
      return d1;
    }
    
    private String e()
    {
      int i = ec.t;
      String str;
      if (i == 0)
      {
        if (q.this.y != null)
        {
          if (i != 0) {
            break label88;
          }
          if (q.this.y.containsKey(gb.h))
          {
            str = (String)q.this.y.get(gb.h);
            return q.this.a(str);
          }
        }
        if (i != 0) {
          break label118;
        }
      }
      if ((q.this.i.c(gb.h) instanceof String))
      {
        label88:
        str = (String)q.this.i.c(gb.h);
        return q.this.a(str);
      }
      label118:
      if (i == 0) {}
      return this.f.a(new Double(this.a), q.D == null ? (q.D = q.b("java.lang.Double")) : q.D);
    }
    
    private String f()
    {
      int i = ec.t;
      String str;
      if (i == 0)
      {
        if (q.this.y != null)
        {
          if (i != 0) {
            break label88;
          }
          if (q.this.y.containsKey(gb.g))
          {
            str = (String)q.this.y.get(gb.g);
            return q.this.a(str);
          }
        }
        if (i != 0) {
          break label118;
        }
      }
      if ((q.this.i.c(gb.g) instanceof String))
      {
        label88:
        str = (String)q.this.i.c(gb.g);
        return q.this.a(str);
      }
      label118:
      if (i == 0) {}
      return this.f.a(new Double(this.c), q.D == null ? (q.D = q.b("java.lang.Double")) : q.D);
    }
  }
  
  private final class d_
    extends q.b_
  {
    final int a;
    final int b;
    final jb c;
    
    public d_(nc paramnc)
    {
      super(null);
      Number localNumber1 = (Number)paramnc.c(nc.y);
      Number localNumber2 = (Number)paramnc.c(nc.z);
      this.a = localNumber1.intValue();
      this.b = localNumber2.intValue();
      this.c = new t(this.a, this.b);
    }
    
    public d_(int paramInt1, int paramInt2)
    {
      super(null);
      this.a = paramInt1;
      this.b = paramInt2;
      this.c = new t(paramInt1, paramInt2);
    }
    
    jb a()
    {
      return this.c;
    }
    
    void c(Number paramNumber)
    {
      if (paramNumber == null) {
        throw new IllegalArgumentException("Item value may not be null.");
      }
      q.this.w.a(false);
      q.this.t.setValue(paramNumber.intValue());
      q.this.w.a(true);
    }
    
    Number b()
    {
      return new Integer(q.this.t.getValue());
    }
    
    Number c()
    {
      int j = ec.t;
      int i = q.this.t.getValue();
      try
      {
        if (j == 0) {}
        Integer localInteger1 = (Integer)this.c.a(q.this.u.getText(), q.C == null ? (q.C = q.b("java.lang.Integer")) : q.C);
        if ((j != 0) || (localInteger1 == null)) {
          localInteger1 = new Integer(i);
        }
        if (j == 0) {}
        q.this.u.setText(this.c.a(localInteger1, q.C == null ? (q.C = q.b("java.lang.Integer")) : q.C));
        return localInteger1;
      }
      catch (NumberFormatException localNumberFormatException)
      {
        Integer localInteger2 = new Integer(i);
        if (j == 0) {}
        q.this.u.setText(this.c.a(localInteger2, q.C == null ? (q.C = q.b("java.lang.Integer")) : q.C));
        return localInteger2;
      }
    }
    
    void b(Number paramNumber)
    {
      fe localfe = new fe();
      if (ec.t == 0)
      {
        if (Boolean.TRUE.equals(q.this.i.c(nc.A))) {
          localfe.a(true);
        }
        q.this.u.setDocument(localfe);
      }
      JLabel localJLabel1 = new JLabel(d(), 4);
      localJLabel1.setFont(localJLabel1.getFont().deriveFont(q.n));
      localJLabel1.setAlignmentX(1.0F);
      JLabel localJLabel2 = new JLabel(e(), 2);
      localJLabel2.setHorizontalAlignment(2);
      localJLabel2.setAlignmentX(1.0F);
      localJLabel2.setFont(localJLabel1.getFont());
      Hashtable localHashtable = new Hashtable(5);
      localHashtable.put(new Integer(this.a), localJLabel1);
      localHashtable.put(new Integer(this.b), localJLabel2);
      q.this.t.setMinimum(this.a);
      q.this.t.setMaximum(this.b);
      q.this.t.setLabelTable(localHashtable);
      c(paramNumber);
      a(paramNumber);
    }
    
    private String d()
    {
      int i = ec.t;
      String str;
      if (i == 0)
      {
        if (q.this.y != null)
        {
          if (i != 0) {
            break label88;
          }
          if (q.this.y.containsKey(gb.h))
          {
            str = (String)q.this.y.get(gb.h);
            return q.this.a(str);
          }
        }
        if (i != 0) {
          break label118;
        }
      }
      if ((q.this.i.c(gb.h) instanceof String))
      {
        label88:
        str = (String)q.this.i.c(gb.h);
        return q.this.a(str);
      }
      label118:
      if (i == 0) {}
      return this.c.a(new Integer(this.a), q.C == null ? (q.C = q.b("java.lang.Integer")) : q.C);
    }
    
    private String e()
    {
      int i = ec.t;
      String str;
      if (i == 0)
      {
        if (q.this.y != null)
        {
          if (i != 0) {
            break label88;
          }
          if (q.this.y.containsKey(gb.g))
          {
            str = (String)q.this.y.get(gb.g);
            return q.this.a(str);
          }
        }
        if (i != 0) {
          break label118;
        }
      }
      if ((q.this.i.c(gb.g) instanceof String))
      {
        label88:
        str = (String)q.this.i.c(gb.g);
        return q.this.a(str);
      }
      label118:
      if (i == 0) {}
      return this.c.a(new Integer(this.b), q.C == null ? (q.C = q.b("java.lang.Integer")) : q.C);
    }
  }
  
  private abstract class b_
  {
    private b_() {}
    
    void a(Number paramNumber, byte paramByte)
    {
      int i = ec.t;
      boolean bool = ec.s;
      if (i == 0)
      {
        switch (paramByte)
        {
        case 0: 
          a(paramNumber);
          if (i == 0)
          {
            if (q.this.t.getValueIsAdjusting()) {
              return;
            }
            q.this.a(paramNumber);
            q.this.d(false);
          }
          if (i == 0) {
            if (!bool) {
              return;
            }
          }
        case 1: 
          c(paramNumber);
          q.this.a(paramNumber);
          q.this.d(false);
          if (i != 0) {
            break label123;
          }
          if (!bool) {
            return;
          }
          break;
        }
        c(paramNumber);
      }
      label123:
      a(paramNumber);
    }
    
    void a(Number paramNumber)
    {
      int i = ec.t;
      q.this.v.a(false);
      if (i == 0) {}
      String str = a().a(paramNumber, q.B == null ? (q.B = q.b("java.lang.Number")) : q.B);
      if (i == 0) {}
      q.this.u.setText(str != null ? str : "");
      q.this.v.a(true);
    }
    
    abstract jb a();
    
    abstract void b(Number paramNumber);
    
    abstract void c(Number paramNumber);
    
    abstract Number b();
    
    abstract Number c();
    
    b_(q.0 param0)
    {
      this();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.q

 * JD-Core Version:    0.7.0.1

 */